home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / ada / gnat1792.zip / gnat179b / t-adainc / a-tasatt.adb < prev    next >
Text File  |  1994-05-19  |  3KB  |  82 lines

  1. ------------------------------------------------------------------------------
  2. --                                                                          --
  3. --                         GNAT RUNTIME COMPONENTS                          --
  4. --                                                                          --
  5. --                  A D A . T A S K _ A T T R I B U T E S                   --
  6. --                                                                          --
  7. --                                 B o d y                                  --
  8. --                                                                          --
  9. --                            $Revision: 1.1 $                              --
  10. --                                                                          --
  11. --           Copyright (c) 1992,1993,1994 NYU, All Rights Reserved          --
  12. --                                                                          --
  13. -- GNAT is free software;  you can  redistribute it  and/or modify it under --
  14. -- terms of the  GNU General Public License as published  by the Free Soft- --
  15. -- ware  Foundation;  either version 2,  or (at your option) any later ver- --
  16. -- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
  17. -- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
  18. -- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
  19. -- for  more details.  You should have  received  a copy of the GNU General --
  20. -- Public License  distributed with GNAT;  see file COPYING.  If not, write --
  21. -- to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. --
  22. --                                                                          --
  23. ------------------------------------------------------------------------------
  24.  
  25. --  Temporary version, not task aware yet!
  26.  
  27. package body Ada.Task_Attributes is
  28.  
  29.    type Attribute_Handle is access all Attribute;
  30.  
  31.    Attribute_Value : aliased Attribute;
  32.    --  Stored value of attribute for environment task
  33.  
  34.    ---------------
  35.    -- Reference --
  36.    ---------------
  37.  
  38.    function Reference
  39.      (T    : Task_Identification.Task_Id := Task_Identification.Current_Task)
  40.       return Attribute_Handle
  41.    is
  42.    begin
  43.       return Attribute_Value'Access;
  44.    end Reference;
  45.  
  46.    ------------------
  47.    -- Reinitialize --
  48.    ------------------
  49.  
  50.    procedure Reinitialize
  51.      (T : Task_Identification.Task_Id := Task_Identification.Current_Task)
  52.    is
  53.    begin
  54.       Set_Value (Initial_Value, T);
  55.    end Reinitialize;
  56.  
  57.    ---------------
  58.    -- Set_Value --
  59.    ---------------
  60.  
  61.    procedure Set_Value
  62.      (Val : Attribute;
  63.       T   : Task_Identification.Task_Id := Task_Identification.Current_Task)
  64.    is
  65.    begin
  66.       Reference (T).all := Val;
  67.    end Set_Value;
  68.  
  69.    -----------
  70.    -- Value --
  71.    -----------
  72.  
  73.    function Value
  74.      (T    : Task_Identification.Task_Id := Task_Identification.Current_Task)
  75.       return Attribute
  76.    is
  77.    begin
  78.       return Reference (T).all;
  79.    end Value;
  80.  
  81. end Ada.Task_Attributes;
  82.